<?php // no direct access
defined('_JEXEC') or die('Restricted access');
$cparams =& JComponentHelper::getParams('com_media');
include_once dirname(__FILE__).DS.'route.php';
JRequest::setVar('limit',10000);
$model = $this->getModel();
$model->_data = null;
$items = $model->getData();
$root = JURI::root();
$root = substr($root,0,strlen($root)-1);
foreach($items as $item)
{	
	$strXMLSitemap .="<url>";
	$url = $root.JRoute::_(ContentSiteMapRoute::getArticleRoute($item->slug, $item->catslug, $item->sectionid));
	$strXMLSitemap .="<loc>$url";
	$strXMLSitemap .="</loc>";
	$strXMLSitemap .="</url>";
}
$xml ='<?xml version="1.0" encoding="UTF-8"?>';
$xml.= '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
        xmlns:image="http://www.sitemaps.org/schemas/sitemap-image/1.1"
        xmlns:video="http://www.sitemaps.org/schemas/sitemap-video/1.1">';
$xml .= $strXMLSitemap;
$xml .= "</urlset>";
echo $xml;die;
?>

